using UnityEngine;
using QFramework;
using System.Linq;

namespace ProjectSurvivor
{
	public partial class AbllitiesController : ViewController, IController
	{

		void Start()
		{
			Global.SimpleSwordUnlocked.RegisterWithInitValue(unlocked =>
			{
				if (unlocked)
				{
					SimpleRotateSword.Show();
				}
			}).UnRegisterWhenGameObjectDestroyed(gameObject);
			Global.SimpleKnifeUnlocked.RegisterWithInitValue(unlocked =>
			{
				if (unlocked)
				{
					SimpleKnifeSword.Show();
				}
			}).UnRegisterWhenGameObjectDestroyed(gameObject);
			Global.RotateSwordUnlocked.RegisterWithInitValue(unlocked =>
			{
				if (unlocked)
				{
					SimpleAex.Show();
				}
			}).UnRegisterWhenGameObjectDestroyed(gameObject);
			Global.noRotateSwordUnlocked.RegisterWithInitValue(unlocked =>
			{
				if (unlocked)
				{
					SimleKnife.Show();
				}
			}).UnRegisterWhenGameObjectDestroyed(gameObject);
			Global.BasketBallUnlocked.RegisterWithInitValue(unlocked =>
			{
				if (unlocked)
				{
					BaskeBallAbility.Show();
				}
			}).UnRegisterWhenGameObjectDestroyed(gameObject);
			//随机生成一个
			//this.GetSystem<ExpUpgrdeSystem>().Items.Where(item=>item.Isweapon).ToList().GetRandomItem().Upgrade();
			Global.SimpleKnifeUnlocked.Value = true;
			Global.SimpleSwordCount.Value++;
		}
		public IArchitecture GetArchitecture()
        {
			return Global.Interface;
        }

	}
}
